package com.goldenaxe.main;

import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;
import com.golden.gamedev.object.Sprite;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

public class GoldenAXE extends Game{

    BufferedImage[] images = null;
    Sprite sprite1 = null;
	
	@Override
    public void initResources() {
		images = getImages("resources/sprites/spriteTest.png",4,1);
		sprite1 = new Sprite(images[0],0,0);
		System.out.println("Sprite images "+images.length);
    }

    @Override
    public void render(Graphics2D g) {
        // TODO Auto-generated method stub
    	g.setColor(Color.WHITE);
        g.fillRect(0, 0, getWidth(), getHeight());
        sprite1.render(g);
        
    }

    @Override
    public void update(long arg0) {
    	sprite1.update(arg0);
        
    }
    
    public static void main(String[] args) {
        GameLoader game = new GameLoader();
        game.setup(new GoldenAXE(), new Dimension(640,480), false);
        game.start();
    }

}
